//
//  SettingViewController.m
//  25frames
//
//  Created by liang xie on 10/22/15.
//  Copyright © 2015 xieliang. All rights reserved.
//

#import "SettingViewController.h"

@interface SettingViewController ()

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"设置";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
//- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
//    // Get the new view controller using [segue destinationViewController].
//    // Pass the selected object to the new view controller.
//}


#pragma mark - UITableViewDataSource & UITableViewDelegate
//data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SettingCell *cell = (SettingCell*)[tableView dequeueReusableCellWithIdentifier:@"setting_cell"];
    switch (indexPath.row) {
        case 0:
            cell.leftLabel.text = @"当前版本";
            cell.rightLabel.text = @"V1.10";
            cell.rightLabel.hidden = NO;
            cell.rightImageView.hidden = YES;
            break;
        case 1:
            cell.leftLabel.text = @"清理缓存";
            cell.rightLabel.text = @"当前缓存2.5M";
            cell.rightLabel.hidden = NO;
            cell.rightImageView.hidden = YES;
            break;
        case 2:
            cell.leftLabel.text = @"关于25帧";
            cell.rightImageView.image = [UIImage imageNamed:@"icon_BG_25"];
            cell.rightLabel.hidden = YES;
            cell.rightImageView.hidden = NO;
            break;
        case 3:
            cell.leftLabel.text = @"联系我们";
            cell.rightImageView.image = [UIImage imageNamed:@"icon_BG_phone"];
            cell.rightLabel.hidden = YES;
            cell.rightImageView.hidden = NO;
            break;
        case 4:
            cell.leftLabel.text = @"意见反馈";
            cell.rightImageView.image = [UIImage imageNamed:@"icon_BG_letter_s"];
            cell.rightLabel.hidden = YES;
            cell.rightImageView.hidden = NO;
            break;
        default:
            break;
    }
    return cell;
}

//delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    switch (indexPath.row) {
        case 0:
            
            
            break;
        case 1:
            
            break;
        case 2:
        {
            AboutViewController *aboutCon = [self.storyboard instantiateViewControllerWithIdentifier:@"about_con"];
            [self.navigationController pushViewController:aboutCon animated:YES];
            break;
        }
        case 3:
        {
            ContactUsViewController *contactUsCon = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactUsViewController"];
            [self.navigationController pushViewController:contactUsCon animated:YES];
            break;
        }
        case 4:
        {
            FeedbackViewController *FeedbackCon = [self.storyboard instantiateViewControllerWithIdentifier:@"FeedbackViewController"];
            [self.navigationController pushViewController:FeedbackCon animated:YES];
            break;
        }
        default:
            break;
    }
}

@end
